﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.Practices.SPG.Common.ListRepository;

namespace IntelligentDecisioning.SharePoint.Definition.Lists
{
    public class SharePointContactList: SharePointList
    {

        #region Constants

        public static readonly Guid LAST_NAME =         new Guid("fa564e0f-0c70-4ab9-b863-0177e6ddd247");
        public static readonly Guid FIRST_NAME =        new Guid("4a722dd4-d406-4356-93f9-2550b8f50dd0");
        public static readonly Guid FULL_NAME =         new Guid("475c2610-c157-4b91-9e2d-6855031b3538");
        public static readonly Guid EMAIL_ADDRESS =     new Guid("fce16b4c-fe53-4793-aaab-b4892e736d15");
        public static readonly Guid COMPANY =           new Guid("038d1503-4629-40f6-adaf-b47d1ab2d4fe");
        public static readonly Guid JOB_TITLE =         new Guid("c4e0f350-52cc-4ede-904c-dd71a3d11f7d");
        public static readonly Guid BUSINESS_PHONE =    new Guid("fd630629-c165-4513-b43c-fdb16b86a14d");
        public static readonly Guid HOME_PHONE =        new Guid("2ab923eb-9880-4b47-9965-ebf93ae15487");
        public static readonly Guid MOBILE_PHONE =      new Guid("2a464df1-44c1-4851-949d-fcd270f0ccf2");
        public static readonly Guid FAX_NUMBER =        new Guid("9d1cacc8-f452-4bc1-a751-050595ad96e1");
        public static readonly Guid ADDRESS =           new Guid("fc2e188e-ba91-48c9-9dd3-16431afddd50");
        public static readonly Guid CITY =              new Guid("6ca7bd7f-b490-402e-af1b-2813cf087b1e");
        public static readonly Guid STATE_PROVINCE =    new Guid("ceac61d3-dda9-468b-b276-f4a6bb93f14f");
        public static readonly Guid ZIP_POSTAL_CODE =   new Guid("9a631556-3dac-49db-8d2f-fb033b0fdc24");
        public static readonly Guid COUNTRY_REGION =    new Guid("3f3a5c85-9d5a-4663-b925-8b68a678ea3a");
        public static readonly Guid WEB_PAGE =          new Guid("a71affd2-dcc7-4529-81bc-2fe593154a5f");
        public static readonly Guid NOTES =             new Guid("9da97a8a-1da5-4a77-98d3-4bc10456e700");

        public const String FIRSTNAME = "FirstName";
        public const String LASTNAME = "LinkTitle";
        public const String JOBTITLE = "JobTitle";
        public const String MOBILEPHONE = "CellPhone";
        public const String BUSINESSPHONE = "WorkPhone";
        public const String EMAILADDRESS = "Email";
        #endregion

        #region Constructors

        public SharePointContactList(string name)
            :base(name)
        {
            base.TemplateType = SPListTemplateType.Contacts;
        }

        public SharePointContactList()
            : this("Id Contacts")
        {
            
        }

        #endregion

        #region Field Mappings

        public override List<FieldToEntityPropertyMapping> GetFieldMappings()
        {
            List<FieldToEntityPropertyMapping> mappings = base.GetFieldMappings();
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.FIRST_NAME, "Forename"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.LAST_NAME, "Surname"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.FULL_NAME, "Fullname"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.EMAIL_ADDRESS, "EmailAddress"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.COMPANY, "Company"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.JOB_TITLE, "JobTitle"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.BUSINESS_PHONE, "BusinessPhone"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.HOME_PHONE, "HomePhone"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.BUSINESS_PHONE, "BusinessPhone"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.MOBILE_PHONE, "MobilePhone"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.FAX_NUMBER, "FaxNumber"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.ADDRESS, "Address"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.CITY, "City"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.STATE_PROVINCE, "StateProvince"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.ZIP_POSTAL_CODE, "ZipPostalCode"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.COUNTRY_REGION, "CountryRegion"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.WEB_PAGE, "WebPage"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointContactList.NOTES, "Notes"));
            return mappings;
        } 

        #endregion
    }
}
